package com.itheima.test;

public class ArrTest6 {
    public static void main(String[] args) {
        //需求：定义两个变量，交换两个变量记录的值

        int a = 10;
        int b = 20;
        int tmp = 0;
        System.out.println("交换前a的值为" + a);
        System.out.println("交换前b的值为" + b);
        //交换变量
        tmp = a;
        a = b;
        b = tmp;
        System.out.println("交换后a的值为" + a);
        System.out.println("交换后b的值为" + b);
    }
}
